<!--
 * @Description: Stay hungry，Stay foolish
 * @Author: ''
 * @Date: 2023-10-09 22:44:20
 * @LastEditTime: 2023-10-10 08:46:54
 * @LastEditors: ''
-->
<template>
  <div>This is CountDown</div>
  <div class='demo-inner-divider'>基础用法</div>
  <e-countDown :target="targetTime" v-font="20" />
  <div class="demo-inner-divider">结束触发事件</div>
  <e-count-down :target="targetTime2" @on-end="handleEnd" v-font="20" />

  <countUpMd class="markdown-body" style="margin-top:20px"/>
</template>

<script setup>
import {ref,getCurrentInstance} from "vue"

import countUpMd from "../../docs/count-down.md"

const _time=new Date().getTime() + 3900000
const targetTime=ref(_time)
const targetTime2=ref(new Date().getTime() + 30000)

const instance=getCurrentInstance();

const context=instance.appContext.config.globalProperties

// console.log('i',context)

const handleEnd=()=>{
  context.$Message.info('倒计时结束');
}

</script>
